﻿using System;
using System.ComponentModel;
using Loki;
using Loki.UI;
using Luna.Model;

namespace Luna.UI.Accounting
{
    public class DisplayableAccount : Displayable<LunaModel>
    {
        #region  ID
        private static PropertyChangedEventArgs _IDChangeArgs = ObservableHelper.CreateArgs<DisplayableAccount>(x => x.ID);

        private Guid _ID;

        public Guid ID
        {
            get
            {
                return _ID;
            }

            set
            {
                if (value != _ID)
                {
                    _ID = value;
                    NotifyChanged(_IDChangeArgs);
                }
            }
        }
        #endregion

        #region  Owner
        private static PropertyChangedEventArgs _OwnerChangeArgs = ObservableHelper.CreateArgs<DisplayableAccount>(x => x.Owner);

        private string _Owner;

        public string Owner
        {
            get
            {
                return _Owner;
            }

            set
            {
                if (value != _Owner)
                {
                    _Owner = value;
                    NotifyChanged(_OwnerChangeArgs);
                }
            }
        }
        #endregion

        #region  Bank
        private static PropertyChangedEventArgs _BankChangeArgs = ObservableHelper.CreateArgs<DisplayableAccount>(x => x.Bank);

        private string _Bank;

        public string Bank
        {
            get
            {
                return _Bank;
            }

            set
            {
                if (value != _Bank)
                {
                    _Bank = value;
                    NotifyChanged(_BankChangeArgs);
                }
            }
        }
        #endregion

        #region  Name
        private static PropertyChangedEventArgs _NameChangeArgs = ObservableHelper.CreateArgs<DisplayableAccount>(x => x.Name);

        private string _Name;

        public string Name
        {
            get
            {
                return _Name;
            }

            set
            {
                if (value != _Name)
                {
                    _Name = value;
                    NotifyChanged(_NameChangeArgs);
                }
            }
        }
        #endregion

        #region  CurrentAmount
        private static PropertyChangedEventArgs _CurrentAmountChangeArgs = ObservableHelper.CreateArgs<DisplayableAccount>(x => x.CurrentAmount);

        private decimal _CurrentAmount;

        public decimal CurrentAmount
        {
            get
            {
                return _CurrentAmount;
            }

            set
            {
                if (value != _CurrentAmount)
                {
                    _CurrentAmount = value;
                    NotifyChanged(_CurrentAmountChangeArgs);
                }
            }
        }
        #endregion

        #region  LastValidation
        private static PropertyChangedEventArgs _LastValidationChangeArgs = ObservableHelper.CreateArgs<DisplayableAccount>(x => x.LastValidation);

        private DateTime _LastValidation;

        public DateTime LastValidation
        {
            get
            {
                return _LastValidation;
            }

            set
            {
                if (value != _LastValidation)
                {
                    _LastValidation = value;
                    NotifyChanged(_LastValidationChangeArgs);
                }
            }
        }
        #endregion

        #region  ValidationDelta
        private static PropertyChangedEventArgs _ValidationDeltaChangeArgs = ObservableHelper.CreateArgs<DisplayableAccount>(x => x.ValidationDelta);

        private decimal _ValidationDelta;

        public decimal ValidationDelta
        {
            get
            {
                return _ValidationDelta;
            }

            set
            {
                if (value != _ValidationDelta)
                {
                    _ValidationDelta = value;
                    NotifyChanged(_ValidationDeltaChangeArgs);
                }
            }
        }
        #endregion
    }
}
